from tkinter import *

Y, X, N = int(input("Введите Y ")), int(input("Введите X ")), int(input("Введите коофицент увеличения "))

c = [0, 0, 10, 0, 10, 10, 20, 10, 20, 20, 10, 20, 10, 30, 0, 30, 0, 0]

root = Tk()
root.title("ИТ марафон")
root.geometry("500x500")

canvas = Canvas(bg="red", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

if N == 0 and X>=0 and X<=500 and Y>=0 and Y<=500:
    pass
else:
    if N > 0 and 0*N+X>=0 and 0*N+Y>=0 and 20*N+X<=500 and 20*N+Y<=500:
        pass
    else:
        if N < 0 and 20*N+X>=0 and 20*N+Y>=0 and 0*N+X<=500 and 0*N+Y<=500:
            pass
        else:
            print('Размер фигуры превышает максимальный размер поля')
            exit()

canvas.create_polygon(c[0] * N + X, c[1] * N + Y,
                      c[2] * N + X, c[3] * N + Y,
                      c[4] * N + X, c[5] * N + Y,
                      c[6] * N + X, c[7] * N + Y,
                      c[8] * N + X, c[9] * N + Y,
                      c[10] * N + X, c[11] * N + Y,
                      c[12] * N + X, c[13] * N + Y,
                      c[14] * N + X, c[15] * N + Y,
                      c[16] * N + X, c[17] * N + Y,
                      fill="orange")

root.mainloop()
